@extends('admin.base')

@section('content')
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <h2>退款信息</h2>
        </div>
        
        <div class="layui-card-body">
            <form lay-filter="create-article" class="layui-form" action="{{route('admin.siteorder.refund')}}" method="post" >
                {{csrf_field()}}
                <input type="hidden" name="id" id="id" value="{{$order['id']}}">

                <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                    <legend>退款表单</legend>
                </fieldset>-->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">订单编号</label>
                        <div class="layui-input-inline" >
                            <input type="text" name="order_sn" id="order_sn" value="{{$order['order_sn']??old('order_sn')}}" class="layui-input" lay-verify="order_sn" readonly />
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">订单类型</label>
                        <div class="layui-input-inline" >
                            <input type="text" name="type_str" id="type_str" value="{{$type_arra[$order['type']]}}" class="layui-input" lay-verify="required"/>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">订单金额</label>
                        <div class="layui-input-inline" >
                            <input type="text" name="money" id="money" value="{{$order['money']??old('money')}}" class="layui-input" lay-verify="money"/>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">订单积分</label>
                        <div class="layui-input-inline" >
                            <input type="text" name="points" id="points" value="{{$order['points']??old('points')}}" class="layui-input" lay-verify="points"/>
                        </div>
                    </div>
                </div>



                <div class="layui-form-item layui-form-text">
                    <label for="" class="layui-form-label">订单备注</label>
                    <div class="layui-input-block">
                        <textarea name="remarks" id="remarks" class="layui-textarea">{{$order['remarks']??old('remarks')}}</textarea>
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
@endsection

@section('script')
    <script>
    layui.use(['upload', 'layer', 'form', 'laydate'], function () {
        var $ = layui.jquery
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate;


        form.on('submit(formDemo)', function (data) {

            layer.confirm('确定退款吗？' , function (index) {
                $('.layui-form').submit();
            });
            return false;
        });
    })
    </script>
@endsection
